package com.qs.entities;

import java.sql.Timestamp;
import java.util.Date;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="Feed")
public class Feed implements java.io.Serializable {

	public static final long serialVersionUID = 2056723068030824949L;
	
	public Feed(){
		
	}
	
	@Id
	@Column(name="feed_id")
	public String feedId;
	
	@ManyToOne
	@JoinColumn(name="user_id")
	public User user;
	
	@ManyToOne
	@JoinColumn(name="channel_id")
	public Channel channel;
	
	@OneToMany(fetch = FetchType.LAZY)
	public Set<Comment> comments;
	
	@Column(name="text")
	public String text;
	
	@Column(name="created_on")
	public Timestamp createdOn = new Timestamp((new Date()).getTime());
	
	@Column(name="updated_on")
	public Timestamp updatedOn;
	
}